/**
 * @file Define the dianping controller
 * 
 * @author Steve Gao<gaofu@parllay.com>
 */
const WebBaseController = require('./web-base-controller');
const {SystemServices}  = require('../../constants');

/**
 * The class DianpingController
 * 
 * @description 
 * 
 * @class DianpingController
 * @extends {BaseController}
 */
class DianpingController extends WebBaseController {
    
    get dianpingService() {
        if (!this._dianpingService) {
            this._dianpingService = this.getSystemService(SystemServices.DIANPING_SERVICE);
        }

        return this._dianpingService;
    }

    get name() {
        return 'DianpingController';
    }

    get handlersPath() {
        return 'dianping';
    }

    fetchDianpingShopInfo(shopId, parentCallback) {
        this.dianpingService.fetchDianpingShopInfo(shopId, (result) => {
            parentCallback(result);
        });
    }
}

exports.DianpingController = DianpingController;